<?php

App::uses('CakeEmail', 'Network/Email');
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

class MyEmail {

    function regisCandidateToHr($to, $info) {
        $email = new CakeEmail('smtp');
        $email->to($to);
        //$email->cc('sakorn.s@aware.co.th');
        //$email->replayTo('sakorn.s@aware.co.th');
        $email->subject('New Candidate');
        //$email->attachments(array('D:'));
        $email->viewVars(array(
            'info' => $info
                )
        );
        $email->emailFormat('html'); // u can use both whene user html amnd text
        $email->template('regiscandidatetohr', 'default'); // email view,layout email default
        $email->send();
    }
    
    function sendContact($to,$info){
        $email = new CakeEmail('smtp');
        $email->to($to);
        $email->subject('New customer register from k.'.$info['name']);
        $email->viewVars(array(
            'info' => $info
                )
        );
        $email->emailFormat('html'); // u can use both whene user html amnd text
        $email->template('sendcontact', 'default'); // email view,layout email default
        $email->send();
    }
    
    function avtivateEmail($to, $name, $url,$password) {
        $subJ = 'Account Activation';
        $email = new CakeEmail('smtp');
        $email->to($to);
        //$email->cc('sakorn.s@aware.co.th');
        //$email->replayTo('sakorn.s@aware.co.th');
        $email->subject('GrapeWare: ' . $subJ);
        //$email->attachments(array('D:'));
        $email->viewVars(array(
            'name' => $name,
            'url' => $url,
            'subject' => $subJ,
            'password'=>$password
                )
        );
        $email->emailFormat('html'); // u can use both whene user html amnd text
        $email->template('activate', 'default'); // email view,layout email default
        $email->send();
    }

}

?>
